<?php
/*工具页面*/
namespace Admin\Controller;
use Think\Controller;
use Model\CourseTypeModel;
use Model\StockModel;

class ToolsController extends Controller {
    public $pernum = 8;//每页显示条数
    //输出json结果
    protected function printOut($data){
        header('Content-type: application/json');
        echo json_encode($data);exit;
    }

    //查询课程分类
    public function courseType(){
        $pid = $_POST['pid'];
        $ctModel = new CourseTypeModel();
        $ctRes = $ctModel->allType($pid);
        $this->printOut($ctRes);
    }
    //查询股票
    public function stock(){
        $pid = $_POST['pid'];
        $sModel = new StockModel();
        $ctRes = $sModel->allStock($pid);
        $this->printOut($ctRes);
    }

}